<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <meta name="description" content="A fully featured admin theme which can be used to build CRM, CMS, etc.">
    <meta name="author" content="Coderthemes">

    <link rel="stylesheet" href="/adminstatic/base/base.css"/>
    <script src="/adminstatic/base/baseCss.js"></script>

    <style type="text/css">
        html, body {
            background: #fff;
        }

        .layui-input-block {
            margin-left: 0;
        }
    </style>
</head>

<body class="fixed-left">

<!-- Begin page -->
<div id="wrapper">

    <div class="container">

        <div class="panel panel-default" style="box-shadow: none">
            <div class="panel-body">
                <div id="inputForm" class="form-horizontal">
                    <input type="hidden" name="id" value="<%=id%>"/>
                    <div class="row" style="padding:0 20px">
                        <div class="form-group">
                            <div class="col-xs-12 col-md-4 ">
                                <label for="username"><small class="notNullFlag">*</small> 账户</label>
                                <input class="form-control" type="text" id="username" name="username"
                                       value="<%=username%>" required>
                            </div>
                        </div>
                </div>
                <div id="actions">
                    <button type="button" class="layui-btn layui-btn-normal" id="submitBtn">保存</button>
                    <button type="button" class="layui-btn layui-btn-primary" onclick="closeIframe()">取消</button>
                </div>
            </div><!-- panel-body -->
        </div> <!-- panel -->

    </div> <!-- container -->
</div>
<!-- END wrapper -->
<script src="/adminstatic/base/base.js"></script>
<script type="text/javascript">

    var roleType = '';
    layui.use('form', function () {
        var form = layui.form;
        form.on('radio', function (data) {
            //获取单选的值
            roleType = data.value
            console.log(roleType)
        });
    });

    $("#submitBtn").click(function () {
        var id = $("input[name='id']").val();
        var username = $("input[name='username']").val();
        if (!vaildeParam(username)) {
            layer.msg("账户不能为空", {icon: 5});
            return;
        }


        var api = '/admin/update';
        var data = {
            "id": id,
            "username": username,
        }

        postJSON(api, data, function (res) {
            cleanSuccess(res)
        })

    })
</script>
</body>
</html>